package com.futuristik.modes;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Image.Scaling;

public class Help extends ArkitekMode {

	Skin skin;
	Stage ui;

	String website = "sites.google.com/sites/arkitekhelp";
	
	public Help (Game game) {
		super(game);
	}

	@Override
	public void show () {
		ui = new Stage(480, 320, true);
		
		Image background = new Image(new TextureRegion(new Texture(Gdx.files.internal("data/helpScreen.png"))), Scaling.none, "background");
		background.y = 320-512;

		skin = new Skin(Gdx.files.internal("data/uiskin.json"), Gdx.files.internal("data/uiskin.png"));
		
		ui.addActor(background);
		
		Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
		Gdx.input.setInputProcessor(ui);	
	}
	
	@Override
	public void render (float deltaTime) {
		ui.draw();
		
		if (Gdx.input.isKeyPressed(Keys.ESCAPE)) {
			game.setScreen(new MainMenu(game));
		}
		
		if (Gdx.input.isKeyPressed(Keys.BACK)) {
			game.setScreen(new MainMenu(game));
		}
	}

	@Override
	public void pause () {
	}

	@Override
	public void resume () {
	}

	@Override
	public void dispose () {
	}

	@Override
	public void hide () {
		ui.clear();
		ui.dispose();
	}
}